//
//  thedayaftertomorrowViewController.m
//  weather
//
//  Created by zd2011 on 12-11-21.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "thedayaftertomorrowViewController.h"
#import "todayViewController.h"

@interface thedayaftertomorrowViewController ()

@end

@implementation thedayaftertomorrowViewController
@synthesize delegate;
@synthesize cityDict3;
@synthesize thedayWeather;
@synthesize thedayTemp;
@synthesize thedayWind;
@synthesize thedayDetail;
@synthesize thedayImageView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.navigationItem.title=@"后天";
	// Do any additional setup after loading the view.
    
    //接收传递过来的资料
    self.cityDict3=[self.delegate returnWeatherInfoTo:self];
    
    NSString *weather=[self.cityDict3 objectForKey:@"weather3"];
    //获取今天页面的指针，并获取代理，设置背景
    todayViewController *controller=[[[self navigationController]viewControllers]objectAtIndex:0];
    [controller.delegate weatherNeedDisplay:weather toController:self];
    

    //将代理重新设为self
    self.delegate=self;
    //调用代理方法显示
    [self.delegate weatherInfoDisplay];

}
-(void)weatherInfoDisplay{
    self.thedayWeather.text=[self.cityDict3 objectForKey:@"weather3"];
    self.thedayTemp.text=[self.cityDict3 objectForKey:@"temp3"];
    self.thedayWind.text=[self.cityDict3 objectForKey:@"wind3"];
    self.thedayDetail.text=[self.cityDict3 objectForKey:@"index_d"];
    
    
    
}

- (void)viewDidUnload
{
    [self setThedayWeather:nil];
    [self setThedayTemp:nil];
    [self setThedayWind:nil];
    [self setThedayDetail:nil];
    [self setThedayImageView:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)backToTomorrow:(UISwipeGestureRecognizer *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
@end
